Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
makeup-next-id
Advanced tools
Assign the next id in sequence to an element, if an id property does not already exist.
Assigns the next id in sequence to an element, if an id property does not already exist. The id will consist of a configurable prefix (default: 'nid'), followed by three randomly generated chars, then a number in sequence. For example: nid-sdv-1
, nid-sdv-2
, nid-sdv-3
, etc. If you need a known id, ahead of time, please use a different approach!
A vanilla JavaScript port of jquery-next-id.
This CommonJS module is still in an experimental state, until it reaches v1.0.0 you must consider all minor releases as breaking changes. Patch releases may introduce new features, but will be backwards compatible.
// via npm
npm install makeup-next-id
// via yarn
yarn add makeup-next-id
// require the module
const nextId = require('makeup-next-id');
// get NodeList
const widgets = document.querySelectorAll('.widget');
// assign next id to each element
widgets.forEach(function(el) {
nextId(el);
});
Markup before:
<div class="widget"></div>
<div class="widget"></div>
<div class="widget"></div>
Markup after:
<div class="widget" id="nid-tCa-1"></div>
<div class="widget" id="nid-tCa-2"></div>
<div class="widget" id="nid-tCa-3"></div>
FAQs
Assign the next id in sequence to an element, if an id property does not already exist.
We found that makeup-next-id demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.